<?php

define('ROOT_DIR', realpath('.'));
define('PREV_DIR', realpath('..'));

require_once(ROOT_DIR . DIRECTORY_SEPARATOR .'config' . DIRECTORY_SEPARATOR . 'config.php');

set_include_path(ROOT_DIR.PATH_SEPARATOR. 
				 ZEND_DIR. PATH_SEPARATOR. 
				 //LIB_DIR. PATH_SEPARATOR.				 
				 MODELS_DIR. PATH_SEPARATOR . 
				 MODELS_COMMON_DIR. PATH_SEPARATOR . 
				 MODELS_MVC_DIR. PATH_SEPARATOR .get_include_path());
				 
require_once(ZEND_DIR . DIRECTORY_SEPARATOR . 'Zend' . DIRECTORY_SEPARATOR . 'Loader.php');
require_once(BOOTSTRAP_FILE);

try{	
	$tt = iBootstrap::getInstance();
	$logWriter = $tt->getLogWtiter();
	$tt->run();
}catch (Exception $e){
	echo $e->getMessage().'<br/><hr/><br/>'.$e->getTraceAsString();
	if(!empty($logWriter) and $logWriter instanceof Zend_Log){
		$logWriter->log($e->getMessage().PHP_EOL.$e->getTraceAsString(),Zend_Log::ERR );
	}
}